function onBridgeReady() {
    WeixinJSBridge.call('hideOptionMenu')
}

export function hideWxMenu() {
    if (typeof WeixinJSBridge == 'undefined') {
        if (document.addEventListener) {
            document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false)
        } else if (document.attachEvent) {
            document.attachEvent('WeixinJSBridgeReady', onBridgeReady)
            document.attachEvent('onWeixinJSBridgeReady', onBridgeReady)
        }
    } else {
        onBridgeReady()
    }
}

function onBridgeReadyBar(){
    WeixinJSBridge.call('hideToolbar');
 }

export function hideWxbar() {
    if (typeof WeixinJSBridge == "undefined"){
        if( document.addEventListener ){
            document.addEventListener('WeixinJSBridgeReady', onBridgeReadyBar, false);
        }else if (document.attachEvent){
            document.attachEvent('WeixinJSBridgeReady', onBridgeReadyBar); 
            document.attachEvent('onWeixinJSBridgeReady', onBridgeReadyBar);
        }
    }else{
        onBridgeReadyBar();
    }
}